package fan.com.httpframe.fragment;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import java.util.ArrayList;

import fan.com.httpframe.R;
import fan.com.httpframe.view.recyclerview.viewholder.RecycleviewViewHolder;

/**
 * 文件名：
 * 描述：
 * 作者：梁帆
 * 时间：2018/5/23 0023
 * 版权：
 */

public class MyFragment extends BaseRefreshFragment<String>{
    ArrayList<String> list = new ArrayList<>();
    @Override
    public void loadListData() {
        list.clear();
        for(int i = 0 ;i< 30; i++){
            list.add("  "+i);
        }
        setListData(list);
        hideLoading();
    }

    @Override
    public RecyclerView.ViewHolder createVH(int viewType) {
        return new MyViewHolder(inflateContentView(R.layout.item_test_fragment));
    }

    @Override
    public void bindVH(RecyclerView.ViewHolder viewHolder, int viewType, int position, Object data) {
        ((MyViewHolder)viewHolder).tv.setText((String)data);
    }
    class MyViewHolder extends RecycleviewViewHolder {

        public TextView tv;
        public MyViewHolder(View view) {
            super(view);
            tv = (TextView) view.findViewById(R.id.tv);
        }
    }


}
